package up7.database.mysql;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import up7.database.sql.SqlFile;
import up7.model.FileInf;
import up7.sql.SqlExec;

public class MySQLFile extends SqlFile {

	/**
	 * 更新子文件路径
	 * @param pathRelOld
	 * @param pathRelNew
	 */
	public void updatePathRel(String pathRelOld,String pathRelNew)
	{
        //更新子文件路径
        String sql = String.format("update up7_files set f_pathRel=REPLACE(f_pathRel,'%s/','%s/') where locate('%s/',f_pathRel)=1",
            pathRelOld,
            pathRelNew,
            pathRelOld
            );
        
        SqlExec se = new SqlExec();
        se.exec(sql);
		
	}
}
